<template>
  <span>
    <el-form
      :label-position="labelPosition"
      label-width="100px"
      :model="formLabelAlign"
    >
      <div>
        <p>图片</p>
        <!-- <el-image
            class="imgBox"
            v-for="item in formLabelAlign.imgs"
            :key="item"
            style="width: 80px; height: 80px"
            :src="imgHeader+ item"
            fit="cover"
          ></el-image> -->
        <el-form-item label="门头图">
          <el-image
            class="imgBox"
            v-for="item in formLabelAlign.door_head_img"
            :key="item"
            style="width: 80px; height: 80px"
            :src="imgHeader + item"
            fit="cover"
          ></el-image>
        </el-form-item>
        <el-form-item label="室内图">
          <el-image
            class="imgBox"
            v-for="item in formLabelAlign.Indoor_img"
            :key="item"
            style="width: 80px; height: 80px"
            :src="imgHeader + item"
            fit="cover"
          ></el-image>
        </el-form-item>
        <el-form-item label="其他">
          <el-image
            class="imgBox"
            v-for="item in formLabelAlign.other_img"
            :key="item"
            style="width: 80px; height: 80px"
            :src="imgHeader + item"
            fit="cover"
          ></el-image>
        </el-form-item>
      </div>
      <div>
        <p>基本信息</p>
        <span v-if="formLabelAlign.type == 2">
          <div class="within">
            <el-form-item label="房源标题">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.housing_source_title"
                placeholder="请输入房源标题"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="区域">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.region_name"
                placeholder="请输入所在区域"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="商铺地址">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.address"
                placeholder="请输入商铺地址"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="楼层房号">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.room_number"
                placeholder="请输入楼层房号"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="商铺类型">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.HousingShopType[0].name"
                placeholder="请输入商铺类型"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="建筑面积">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.architecture_area"
                placeholder="请输入建筑面积"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="经营状态">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.management_status_text"
                placeholder="请输入经营状态"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="适合业态">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.HousingIndustry[0].nameText"
                placeholder="请输入适合业态"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="租金">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.architecture_rent"
                placeholder="请输入租金"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <!-- mode_detain_pay -->
            <el-form-item label="押付方式">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.mode_detain_pay"
                placeholder="请输入押付方式"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="电费">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.electricity_charge"
                placeholder="请输入电费"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="水费">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.water_charge"
                placeholder="请输入水费"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="起租期">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.start_month"
                placeholder="请输入起租期"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="免租期">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.exempt_month"
                placeholder="请输入免租期"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="客流人群">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.passenger_flow_crowd_text"
                placeholder="请输入客流人群"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="是否临街">
              <el-radio-group v-model="formLabelAlign.facing_street">
                <el-radio :disabled="disabled" :label="1">是</el-radio>
                <el-radio :disabled="disabled" :label="2">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="面宽">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.width_building_area"
                placeholder="请输入面宽"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="层高">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.building_floor_height"
                placeholder="请输入层高"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="进深">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.building_depth"
                placeholder="请输入进深"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="朝向">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.towards"
                placeholder="请输入房源朝向"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="地铁站" v-if="formLabelAlign.MetroStation[0]">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.MetroStation[0].station"
                placeholder="请输入地铁站"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
        </span>
        <span v-if="formLabelAlign.type == 3">
          <div class="within">
            <el-form-item label="房源标题">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.housing_source_title"
                placeholder="请输入房源标题"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="区域">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.region_name"
                placeholder="请输入所在区域"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="写字楼地址">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.address"
                placeholder="请输入写字楼地址"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="楼层房号">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.room_number"
                placeholder="请输入楼层房号"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="写字楼类型">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.HousingShopType[0].name"
                placeholder="请输入写字楼类型"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="写字楼装修">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.office_building"
                placeholder="请输入写字楼装修"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="使用率" class="threeBox">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.use_area"
                placeholder="请输入使用率"
                class="wiIndex"
              ></el-input>
              <span class="percentage">%</span>
            </el-form-item>

            <el-form-item label="建筑面积">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.architecture_area"
                placeholder="请输入建筑面积"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="工位">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.work_station"
                placeholder="请输入工位"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="租金">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.architecture_rent"
                placeholder="请输入租金"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="押付方式">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.mode_detain_pay"
                placeholder="请输入押付方式"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="可否注册">
              <el-radio-group v-model="formLabelAlign.is_register_num">
                <el-radio :disabled="disabled" :label="1">是</el-radio>
                <el-radio :disabled="disabled" :label="2">否</el-radio>
              </el-radio-group>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="起租期">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.start_month"
                placeholder="请输入起租期"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="免租期">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.exempt_month"
                placeholder="请输入免租期"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="可否分割">
              <el-radio-group v-model="formLabelAlign.split_up_num">
                <el-radio :disabled="disabled" :label="1">是</el-radio>
                <el-radio :disabled="disabled" :label="2">否</el-radio>
              </el-radio-group>
            </el-form-item>
            <el-form-item label="性质">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.office_nature"
                placeholder="请输入性质"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="朝向">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.towards"
                placeholder="请输入房源朝向"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="地铁站" v-if="formLabelAlign.MetroStation[0]">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.MetroStation[0].station"
                placeholder="请输入地铁站"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
        </span>
        <span v-if="formLabelAlign.type == 1">
          <div class="within">
            <el-form-item label="房源标题">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.housing_source_title"
                placeholder="请输入房源标题"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="区域">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.region_name"
                placeholder="请输入区域"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="朝向">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.towards"
                placeholder="请输入房源朝向"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="商铺地址">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.address"
                placeholder="请输入商铺地址"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="商铺类型">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.HousingShopType[0].name"
                placeholder="请输入商铺类型"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="适合业态">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.HousingIndustry[0].nameText"
                placeholder="请输入适合业态"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="建筑面积">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.architecture_area"
                placeholder="请输入建筑面积"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="租金">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.architecture_rent"
                placeholder="请输入租金"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="剩余租期">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.remaining_lease_term"
                placeholder="请输入剩余租期"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="转让费">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.transfer_fee"
                placeholder="请输入转让费"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="客流人群">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.passenger_flow_crowd_text"
                placeholder="请输入客流人群"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="地铁站" v-if="formLabelAlign.MetroStation[0]">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.MetroStation[0].station"
                placeholder="请输入地铁站"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
        </span>
        <span v-if="formLabelAlign.type == 4">
          <div class="within">
            <el-form-item label="房源标题">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.housing_source_title"
                placeholder="请输入房源标题"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="朝向">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.towards"
                placeholder="请输入房源朝向"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="区域">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.region_name"
                placeholder="请输入所在区域"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="建筑面积">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.architecture_area"
                placeholder="请输入建筑面积"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="住宅地址">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.address"
                placeholder="请输入住宅地址"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="住宅层高">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.residential"
                placeholder="请输入住宅层高"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="房型住宅">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.housingType"
                placeholder="请输入房型住宅"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="套型分类">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.jacketedType"
                placeholder="请输入套型分类"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="租金">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.architecture_rent"
                placeholder="请输入租金"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="押付方式">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.mode_detain_pay"
                placeholder="请输入押付方式"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="起租期">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.start_month"
                placeholder="请输入起租期"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="免租期">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.exempt_month"
                placeholder="请输入免租期"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="电费">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.electricity_charge"
                placeholder="请输入电费"
                class="wiIndex"
              ></el-input>
            </el-form-item>
            <el-form-item label="水费">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.water_charge"
                placeholder="请输入水费"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
          <div class="within">
            <el-form-item label="地铁站" v-if="formLabelAlign.MetroStation[0]">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.MetroStation[0].station"
                placeholder="请输入地铁站"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div>
        </span>
      </div>
      <div>
        <p>配套设施</p>
        <!-- formLabelAlign.supportingFacilities[index].name -->
        <span v-for="item in formLabelAlign.supportingFacilities" :key="item">{{
          item
        }}</span>
      </div>
      <div class="houseTag">
        <p>房源标签</p>
        <span v-for="item in formLabelAlign.propertyTags" :key="item">{{
          item
        }}</span>
      </div>
      <div class="houseInfo">
        <p>房源信息</p>
        <!-- <div class="within">
            <el-form-item label="房源标题">
              <el-input
                :disabled="disabled"
                v-model="formLabelAlign.housing_source_title"
                placeholder="请输入房源标题"
                class="wiIndex"
              ></el-input>
            </el-form-item>
          </div> -->
        <div>
          <el-form-item label="房源介绍">
            <el-input
              type="textarea"
              :autosize="{ minRows: 2, maxRows: 10 }"
              :disabled="disabled"
              v-model="formLabelAlign.Introduction"
              placeholder="请输入房源介绍"
              class="wiIndex"
            ></el-input>
          </el-form-item>
        </div>
        <div>
          <el-form-item label="房产证" v-if="formLabelAlign.type != 1">
            <el-image
              style="width: 200px; height: 120px"
              :src="imgHeader + formLabelAlign.real_estate_certificate"
              fit="cover"
            ></el-image>
          </el-form-item>
        </div>
      </div>

      <div>
        <p>联系人</p>
        <div class="within">
          <el-form-item label="联系人">
            <el-input
              :disabled="disabled"
              v-model="formLabelAlign.name"
              placeholder="请输入联系人"
              class="wiIndex"
            ></el-input>
          </el-form-item>
        </div>
        <div class="within">
          <el-form-item label="手机号">
            <el-input
              :disabled="disabled"
              v-model="formLabelAlign.phone"
              placeholder="请输入手机号"
              class="wiIndex"
            ></el-input>
          </el-form-item>
        </div>
        <div class="within">
          <el-form-item label="性别">
            <el-input
              :disabled="disabled"
              v-model="formLabelAlign.gender_text"
              placeholder="请输入性别"
              class="wiIndex"
            ></el-input>
          </el-form-item>
        </div>
      </div>
      <div class="btnBox">
        <el-button
          type="danger"
          v-if="formLabelAlign1.sttus == 1"
          @click="handleEdit2(scope.row)"
          >拒绝</el-button
        >
        <el-button
          type="success"
          v-if="formLabelAlign1.sttus == 1"
          @click="handleEdit1(scope.row)"
          >同意</el-button
        >
        <!-- <el-button type="primary" @click="handleBack">返回</el-button> -->
      </div>
    </el-form>
  </span>
</template>

<script>
import {
  getHouseList,
  getHouseListStatus,
  getHouseListDetail,
  getsupportingFacilities,
  getPropertyTags,
  getBusinessFormat,
} from "../../utils/main";
export default {
  name: "houseOrder",
  props: ["houseId"],
  data() {
    return {
      options: [
        {
          id: "1",
          name: "材料费+工时费",
        },
        {
          id: "2",
          name: "工时费",
        },
      ],
      optionsType: [
        {
          id: "1",
          name: "商铺转让",
        },
        {
          id: "2",
          name: "商铺租赁",
        },
        {
          id: "3",
          name: "写字楼租赁",
        },
        {
          id: "4",
          name: "住宅租赁",
        },
      ],
      optionsStatus: [
        {
          id: 1,
          name: "上架",
        },
        {
          id: 2,
          name: "下架",
        },
        {
          id: 3,
          name: "同意",
        },
        {
          id: 4,
          name: "驳回",
        },
      ],
      labelPosition: "right",
      value: "",
      formInline: {
        housing_source_title: "",
        name: "",
        phone: "",
        type: "",
      },
      imgHeader: this.Global.imgHeader,
      formLabelAlign: {
        name: "",
      },
      // titleText: "新增工种",
      disabled: true,
      loading: false,
      token: sessionStorage.getItem("token"),
      dialogVisible: false,
      propertyTags: [],
      supportingFacilities: [],
      tableData: [],
      formLabelAlign1: {},
      list: [],
      radio: 2,
      //当前页数
      page: 1,
      limit: 10,
      total: 0,
      currentPage: 1,
      state: "",
      status: "",
      is_up: "",
      name: "",
      // 1是业主，2是经纪人
      is_proprietor: 1,
      rules: {
        name: [{ required: true, message: "请输入工种", trigger: "blur" }],
      },
    };
  },
  methods: {
    stateChange() {
      // 上架
      if (this.state == 1) {
        this.is_up = 1;
        this.status = "";
      }
      // 下架
      if (this.state == 2) {
        this.is_up = 2;
        this.status = "";
      }
      // 同意
      if (this.state == 3) {
        this.status = 2;
        this.is_up = "";
      }
      // 拒绝
      if (this.state == 4) {
        this.status = 3;
        this.is_up = "";
      }
      console.log(this.is_up, this.status);
    },

    getParentId(list, pid) {
      for (let item of list || []) {
        if (item.id == pid) return item.name;
      }
    },
    goodsSonSort(token, page, limit, id) {
      this.loading = true;
      getBusinessFormat(token, page, limit, id).then((res) => {
        if (res.data.status) {
          this.list = res.data.data.data;
          // this.total = res.data.data.count;
          let timer = setTimeout(() => {
            this.loading = false;
            clearTimeout(timer);
          }, 400);
        } else {
          if (res.data.msg == "token失效,请重新进行登录") {
            this.$router.push("/login");
          }
          this.$message.error(res.data.msg);
          this.loading = false;
        }
      });
    },
    // 获取房源管理列表详情
    async getListDetail(id) {
      // this.loading = true;
      let res = await getHouseListDetail(this.token, id);
      if (res.data.status) {
        this.formLabelAlign = res.data.data || {};
        if (this.formLabelAlign.type == 4) {
          this.formLabelAlign.jacketedType =
            res.data.data.room_suit +
            "室" +
            res.data.data.office +
            "厅" +
            res.data.data.lavatory +
            "卫";
          if (res.data.data.shop_type == 1) {
            this.formLabelAlign.housingType = "单元式住宅";
          } else if (res.data.data.shop_type == 2) {
            this.formLabelAlign.housingType = "公寓式住宅";
          } else if (res.data.data.shop_type == 3) {
            this.formLabelAlign.housingType = "复式住宅";
          } else if (res.data.data.shop_type == 4) {
            this.formLabelAlign.housingType = "跃层式住宅";
          } else if (res.data.data.shop_type == 5) {
            this.formLabelAlign.housingType = "花园洋房式住宅";
          } else if (res.data.data.shop_type == 6) {
            this.formLabelAlign.housingType = "别墅";
          }
        }

        if (this.formLabelAlign.HousingIndustry.length > 0) {
          let name = this.getParentId(
            this.list,
            this.formLabelAlign.HousingIndustry[0].pid
          );
          this.formLabelAlign.HousingIndustry[0].nameText =
            name + " - " + this.formLabelAlign.HousingIndustry[0].name;
          console.log("name", name);
        }

        // 图片
        // let imgArray = [];
        this.formLabelAlign.Indoor_img =
          this.formLabelAlign.housing_source_Indoor_img.split(",");
        this.formLabelAlign.door_head_img =
          this.formLabelAlign.housing_source_door_head_img.split(",");
        this.formLabelAlign.other_img =
          this.formLabelAlign.housing_source_other_img.split(",");

        // this.formLabelAlign.imgs = imgArray;
        // console.log(imgArray);
        // 押付方式
        this.formLabelAlign.mode_detain_pay =
          "押" +
          this.formLabelAlign.mode_detain +
          "付" +
          this.formLabelAlign.mode_pay;
        // 判断客流人群
        if (this.formLabelAlign.passenger_flow_crowd != null) {
          let flowCrowd = this.formLabelAlign.passenger_flow_crowd
            .split(",")
            .map(Number);
          console.log(this.formLabelAlign.passenger_flow_crowd);
          let flow_crowd_text = "";
          flowCrowd.forEach((item) => {
            item == 1
              ? (item = "办公人群")
              : item == 2
              ? (item = "旅游人群")
              : item == 3
              ? (item = "居民人群")
              : item == 4
              ? (item = "学生人群")
              : item == 5
              ? (item = "其他")
              : "";
            flow_crowd_text += item + " ";
          });
          this.formLabelAlign.passenger_flow_crowd_text = flow_crowd_text;
        } else {
          this.formLabelAlign.passenger_flow_crowd_text = "";
        }
        // console.log(this.formLabelAlign.passenger_flow_crowd_text);
        // 判断性别
        if (this.formLabelAlign.gender == 1) {
          this.formLabelAlign.gender_text = "男";
        } else {
          this.formLabelAlign.gender_text = "女";
        }
        // 判断经营状态
        if (this.formLabelAlign.management_status == 1) {
          this.formLabelAlign.management_status_text = "经营中";
        } else {
          this.formLabelAlign.management_status_text = "空置";
        }
        this.formLabelAlign.is_register_num = Number(
          this.formLabelAlign.is_register
        );
        this.formLabelAlign.split_up_num = Number(this.formLabelAlign.split_up);
        // 配置设套
        let newArr = [];
        let arr1 = this.formLabelAlign.HousingMatchingSourceAssociation;
        console.log("arr1", arr1);
        let arr2 = this.supportingFacilities;
        console.log("arr2", arr2);
        const result = arr2
          .filter((item1) =>
            arr1.some((item2) => item1.id == item2.matching_setting_id)
          )
          .map((item) => item.name);
        this.formLabelAlign.supportingFacilities = result;
        // for (let i = 0; i < arr2.length; i++) {
        //   for (let j = 0; j < arr1.length; j++) {
        //     if (arr1[j].matching_setting_id == arr2[i].id) {
        //       newArr.push(arr2[i].name);
        //     }
        //   }
        // }
        // this.formLabelAlign.supportingFacilities = newArr;

        // console.log("arr", this.formLabelAlign.supportingFacilities);
        // 房源标签
        let newArr2 = [];
        let arr3 = this.formLabelAlign.HousingHousingLabelAssociation;
        let arr4 = this.propertyTags;
        for (let i = 0; i < arr3.length; i++) {
          for (let j = 0; j < arr4.length; j++) {
            if (arr3[i].housing_label_id == arr4[j].id) {
              newArr2.push(arr4[j].name);
            }
          }
        }
        this.formLabelAlign.propertyTags = newArr2;
        console.log("arr2", this.formLabelAlign.propertyTags);

        let timer = setTimeout(() => {
          this.loading = false;
          clearTimeout(timer);
        }, 400);
      } else {
        if (res.data.msg == "token失效,请重新进行登录") {
          this.$router.push("/login");
        }
        if (res.data.msg == "此账号没有权限") {
          this.$message.error(res.data.msg);
          this.loading = false;
        }
        let timer = setTimeout(() => {
          this.$message.error(res.data.msg);
        }, 5000);
      }
    },
    // 配套设施
    async getHouseSupportingFacilities() {
      let res = await getsupportingFacilities(this.token, "", 1, 100);
      if (res.data.status) {
        this.supportingFacilities = res.data.data.data || [];
      } else {
        if (res.data.msg == "token失效,请重新进行登录") {
          this.$router.push("/login");
        }
        if (res.data.msg == "此账号没有权限") {
          this.$message.error(res.data.msg);
          this.loading = false;
        }
        let timer = setTimeout(() => {
          this.$message.error(res.data.msg);
        }, 5000);
      }
    },
    // 房源标签
    async getHousePropertyTags() {
      // this.loading = true;
      let res = await getPropertyTags(this.token, "", 1, 100);
      if (res.data.status) {
        this.propertyTags = res.data.data.data || [];
      } else {
        if (res.data.msg == "token失效,请重新进行登录") {
          this.$router.push("/login");
        }
        if (res.data.msg == "此账号没有权限") {
          this.$message.error(res.data.msg);
          this.loading = false;
        }
        let timer = setTimeout(() => {
          this.$message.error(res.data.msg);
        }, 5000);
      }
    },
    handleBack() {
      this.dialogVisible = false;
    },
    // 详情
    // handleDelete(row) {
    //   let obj = JSON.parse(JSON.stringify(row));
    //   this.formLabelAlign1 = obj;
    //   this.dialogVisible = true;
    //   this.getListDetail();
    // },

    // 排序
    // indexMethod(index) {
    //   if (this.total < this.limit) {
    //     return this.total - index;
    //   } else {
    //     return this.total - (this.page - 1) * this.limit - index;
    //   }
    // },

    //关闭
    handleClose() {
      // this.$refs.form.resetFields();
      this.dialogVisible = false;
    },
  },
  mounted() {
    let id = this.houseId;
    this.getListDetail(id);
    this.getHouseSupportingFacilities();
    this.getHousePropertyTags();
    this.goodsSonSort(this.token, 1, 100, 0);
  },
  created() {
    let id = this.houseId;
    this.getListDetail(id);
  },
  watch: {
    houseId(n, o) {
      this.getListDetail(n);
      console.log(n, o, "///////////////");
    },
  },
};
</script>

<style scoped>
.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}

.clearfix:after {
  clear: both;
}

.box-card {
  width: 100%;
}

.imageGood {
  margin: 0 10px;
}

.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 178px;
  height: 178px;
  line-height: 178px;
  text-align: center;
}

.divWidth {
  width: 70%;
}
.btnBox {
  display: flex;
  justify-content: center;
}
.btnBox {
  display: flex;
  justify-content: center;
}
.within {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
}

.within .el-form-item {
  width: 45%;
}
.imgBox {
  margin-right: 50px;
  margin-bottom: 10px;
}
span {
  margin-left: 15px;
}
p {
  font-size: 18px;
  margin-bottom: 10px;
}
.houseInfo {
  margin-top: 15px;
}
.houseTag {
  margin-top: 15px;
}
.threeBox {
  position: relative;
}
.percentage {
  position: absolute;
  right: -15px;
}
</style>